﻿
using System.ComponentModel.DataAnnotations;
namespace Inovout.Membership.Security
{
    public partial class MailCredential : IMailAuthenticationCredential
    {
        public MailCredential(string mail)
        {
            this.Mail = mail;
        }
        public override string Identity
        {
            get
            {
                int @Location = this.Mail.IndexOf("@");
                return this.Mail.Substring(0, @Location - 2) + "****" + this.mail.Substring(@Location + 2, this.Mail.Length - @Location - 2);
            }
        }

        [Required(ErrorMessage = "密码不可为空")]
        [StringLength(50, ErrorMessage = "密码长度不能超过50个字符")]
        [Alias("邮箱名")]
        public virtual string Password { get; set; }
    }
}
